package com.ruoyi.wcf.controller;

import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.wcf.domain.WcfDisposeShopScene;
import com.ruoyi.wcf.service.IWcfDisposeShopSceneService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 客户管理-店铺场景设置Controller
 *
 * @author ruoyi
 * @date 2022-03-30
 */
@RestController
@RequestMapping("/wcf/wcfDisposeShopScene")
public class WcfDisposeShopSceneController extends BaseController
{
    @Autowired
    private IWcfDisposeShopSceneService wcfDisposeShopSceneService;

    /**
     * 查询客户管理-店铺场景设置列表
     */
    @PreAuthorize("@ss.hasPermi('wcf:wcfDisposeShopScene:list')")
    @GetMapping("/list")
    public TableDataInfo list(WcfDisposeShopScene wcfDisposeShopScene)
    {
        startPage();
        List<WcfDisposeShopScene> list = wcfDisposeShopSceneService.selectWcfDisposeShopSceneList(wcfDisposeShopScene);
        return getDataTable(list);
    }

    /**
     * 导出客户管理-店铺场景设置列表
     */
    @PreAuthorize("@ss.hasPermi('wcf:wcfDisposeShopScene:export')")
    @Log(title = "客户管理-店铺场景设置", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(WcfDisposeShopScene wcfDisposeShopScene)
    {
        List<WcfDisposeShopScene> list = wcfDisposeShopSceneService.selectWcfDisposeShopSceneList(wcfDisposeShopScene);
        ExcelUtil<WcfDisposeShopScene> util = new ExcelUtil<WcfDisposeShopScene>(WcfDisposeShopScene.class);
        return util.exportExcel(list, "客户管理-店铺场景设置数据");
    }

    /**
     * 获取客户管理-店铺场景设置详细信息
     */
    @PreAuthorize("@ss.hasPermi('wcf:wcfDisposeShopScene:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(wcfDisposeShopSceneService.selectWcfDisposeShopSceneById(id));
    }

    /**
     * 新增客户管理-店铺场景设置
     */
    @PreAuthorize("@ss.hasPermi('wcf:wcfDisposeShopScene:add')")
    @Log(title = "客户管理-店铺场景设置", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody WcfDisposeShopScene wcfDisposeShopScene)
    {
        return toAjax(wcfDisposeShopSceneService.insertWcfDisposeShopScene(wcfDisposeShopScene));
    }

    /**
     * 修改客户管理-店铺场景设置
     */
    @PreAuthorize("@ss.hasPermi('wcf:wcfDisposeShopScene:edit')")
    @Log(title = "客户管理-店铺场景设置", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody WcfDisposeShopScene wcfDisposeShopScene)
    {
        return toAjax(wcfDisposeShopSceneService.updateWcfDisposeShopScene(wcfDisposeShopScene));
    }

    /**
     * 删除客户管理-店铺场景设置
     */
    @PreAuthorize("@ss.hasPermi('wcf:wcfDisposeShopScene:remove')")
    @Log(title = "客户管理-店铺场景设置", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(wcfDisposeShopSceneService.deleteWcfDisposeShopSceneByIds(ids));
    }
}
